package com.lh.eemsserver.Controller;

import com.lh.eemsserver.Service.WorkerService;
import com.lh.eemsserver.po.*;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/Worker")
public class WorkerController {

    @Autowired
    private WorkerService workerService;

//    @RequestMapping("/insertMaterialLocation")
//    public int insertMaterialLocation(@RequestBody Material material){
//        return workerService.insertMaterialLocation(material);
//    }

    @RequestMapping("/insertChecker")
    public int insertChecker(@RequestBody Material material){
        return workerService.insertChecker(material);
    }

    @RequestMapping("/insertMaterial")
    public int insertMaterial(@RequestBody Material material){
        return workerService.insertMaterial(material);
    }
    @RequestMapping("/updateWorker")
    public Integer updateWorker(@RequestBody User user){
        return workerService.updateWorker(user);
    }


    @RequestMapping("/getCheckerNum")
    public int getCheckerNum(@RequestBody Material material){
        return workerService.getCheckerNum(material);
    }
    @RequestMapping("/userlogin")
    public User userlogin(@RequestBody User user){
        return workerService.userlogin(user);
    }
    @RequestMapping("/listReportByReporter")
    public List<Report> listReportByReporter(@RequestBody Report report){
        return workerService.listReportByReporter(report);
    }
    @RequestMapping("/listReportByState")
    public List<Report> listReportByState(@RequestBody Report report){
        return workerService.listReportByState(report);
    }
    @RequestMapping("/listReportByReportID")
    public List<Report> listReportByReportID(@RequestBody Report report){
        return workerService.listReportByReportID(report);
    }
    @RequestMapping("/listReportByLastUpdater")
    public List<Report> listReportByLastUpdater(@RequestBody Report report){
        return workerService.listReportByLastUpdater(report);
    }
    @RequestMapping("/getUserByID")
    public User getUserByID(@RequestBody User user){
        return workerService.getUserById(user);
    }
    @RequestMapping("/listAllReport")
    public List<Report> listAllReport() {
        return workerService.listAllReport();
    }

    @RequestMapping("/newReportInfo")
    public int newReportInfo(@RequestBody Report report) {
        return workerService.newReportInfo(report);
    }

    @RequestMapping("/newReporterInfo")
    public int newReporterInfo(@RequestBody Report report){
        return workerService.newReporterInfo(report);
    }
    @RequestMapping("/getReporter")
    public int getReporter(@RequestBody Report report){
       return workerService.getReporter(report);
    }

    @RequestMapping("/listAllCityName")
    public String[] listAllCityName() {
        return workerService.listAllCityName();
    }
    @RequestMapping("/listAllCity")
    public List<City> listAllCity(@RequestBody City city){
        return workerService.listAllCity(city);
    }
    @RequestMapping("/listCityByName")
    public List<City> listCityByName(@RequestBody City city){
        return workerService.listCityByName(city);
    }

    @RequestMapping("/getCityByID")
    public City getCityByID(@RequestBody City city){
        return workerService.getCityByID(city);
    }

    @RequestMapping("/listAllLocationName")
    public String[] listAllLocationName(){
        return workerService.listAllLocationName();
    }
    @RequestMapping("/ListMaterialByLocation")
    public List<Material> ListMaterialByLocation(@RequestBody Material material){
        return workerService.ListMaterialByLocation(material);
    }
    @RequestMapping("/listSelectedCity")
    public List<City> listSelectedCity(String cityName) {
        return workerService.listSelectedCity(cityName);
    }


    @RequestMapping("/renewCityInfo")
    public int renewCityInfo(@RequestBody City city) {
        return workerService.renewCityInfo(city);
    }





    @RequestMapping("/newProcedureInfo")
    public int newProcedureInfo(Procedure procedure) {
        return workerService.newProcedureInfo(procedure);
    }

    @RequestMapping("/delProcedureInfo")
    public int delProcedureInfo(Procedure procedure) {
        return workerService.newProcedureInfo(procedure);
    }

    @RequestMapping("/ListAllMaterialInfo")
    public List<Material> ListAllMaterialInfo() {
        return workerService.ListAllMaterialInfo();
    }

    @RequestMapping("/getMaterialInfoByName")
    public List<Material> getMaterialInfoByName(@RequestBody Material material) {
        return workerService.getMaterialInfoByName(material);
    }

    @RequestMapping("/newMaterialInfo")
    public int newMaterialInfo(Material material) {
        return workerService.newMaterialInfo(material);
    }

//    @RequestMapping("/renewMaterialLocation")
//    public int renewMaterialLocation(Material material) {
//        return workerService.renewMaterialLocation(material);
//    }

    @RequestMapping("/getProcedure")
    public  List<Procedure> getProcedure(@RequestBody Report report) {
        return workerService.getProcedure(report);
    }

    @RequestMapping("/addProcedureStep")
    public int addProcedureStep(@RequestBody Procedure procedure){

        return workerService.addProcedureStep(procedure);
    }
    @RequestMapping("/deleteProcedureStep")
    public int deleteProcedureStep(@RequestBody Procedure procedure){
        return workerService.deleteProcedureStep(procedure);
    }
    @RequestMapping("/renewProcedureStep")
    public int renewProcedureStep(@RequestBody Procedure procedure){
        return workerService.renewProcedureStep(procedure);
    }
    @RequestMapping("/insertProcedureStep")
    public int insertProcedureStep(Procedure procedure) {
        return workerService.insertProcedureStep(procedure);
    }

    @RequestMapping("/downProcedureStep")
    public int downProcedureStep(Procedure procedure) {
        return workerService.downProcedureStep(procedure);
    }

    @RequestMapping("/delProcedureStep")
    public int delProcedureStep(Procedure procedure) {
        return workerService.delProcedureStep(procedure);
    }

    @RequestMapping("/getProcedureByID")
    public Procedure getProcedureByID(Procedure procedure) {
        return workerService.getProcedureByID(procedure);
    }

    @RequestMapping("/newEventType")
    public int newEventType(@RequestBody Event event) {
        return workerService.newEventType(event);
    }

    @RequestMapping("/renewChecker")
    public int renewChecker(@RequestBody Material material){
        return workerService.renewChecker(material);
    }

    @RequestMapping("/renewMaterial")
    public int renewMaterial(@RequestBody Material material){
        return workerService.renewMaterial(material);
    }

    @RequestMapping("/delMaterialInfo")
    public int delMaterialInfo(Material material) {
        return workerService.newMaterialInfo(material);
    }

    @RequestMapping("/delAllMaterialInfo")
    public int delAllMaterialInfo() {
        return workerService.delAllMaterialInfo();
    }

    @RequestMapping("/listAllEnterpriseInfo")
    public List<Enterprise> listAllEnterpriseInfo(Enterprise enterprise) {
        return workerService.listAllEnterpriseInfo(enterprise);
    }

    @RequestMapping("/listEnterpriseInfoByName")
    public List<Enterprise> listEnterpriseInfoByName(@RequestBody Enterprise enterprise) {
        return workerService.listEnterpriseInfoByName(enterprise);
    }

    @RequestMapping("/listEnterpriseInfoByType")
    public List<Enterprise> listEnterpriseInfoByType(@RequestBody Enterprise enterprise) {
        return workerService.listEnterpriseInfoByType(enterprise);
    }



    @RequestMapping("/insertEnterprise")
    public int insertEnterprise(@RequestBody Enterprise enterprise){
        return workerService.insertEnterprise(enterprise);
    }

    @RequestMapping("/newEnterpriseInfo")
    public int newEnterpriseInfo(Enterprise enterprise) {
        return workerService.newEnterpriseInfo(enterprise);
    }

    @RequestMapping("/renewEnterpriseInfo")
    public int renewEnterpriseInfo(Enterprise enterprise) {
        return workerService.renewEnterpriseInfo(enterprise);
    }

    @RequestMapping("/delEnterpriseInfo")
    public int delEnterpriseInfo(Enterprise enterprise) {
        return workerService.delEnterpriseInfo(enterprise);
    }

    @RequestMapping("/delAllEnterpriseInfo")
    public int delAllEnterpriseInfo() {
        return workerService.delAllEnterpriseInfo();
    }

    @RequestMapping("/listAllEventInfo")
    public List<Event> listAllEventInfo() {
        return workerService.listAllEventInfo();
    }
    @RequestMapping("/listAllEventType")
    public String[] listAllEventType(){
        return workerService.listAllEventType();
    }

    @RequestMapping("/listEventInfoByName")
    public List<Event> listEventInfoByName(@RequestBody Event event) {
        return workerService.listEventInfoByName(event);
    }
    @RequestMapping("/listEventInfoByType")
    public List<Event> listEventInfoByType(@RequestBody Event event){
        return workerService.listEventInfoByType(event);
    }
    @RequestMapping("/getEventInfoByID")
    public Event getEventInfoByID(@RequestBody Event event){
        return workerService.getEventInfoByID(event);
    }

    @RequestMapping("/listEventInfoByRank")
    public List<Event> listEventInfoByRank(@RequestBody Event event) {
        return workerService.listEventInfoByRank(event);
    }

    @RequestMapping("/renewEventInfo")
    public int renewEventInfo(@RequestBody Event event) {
        return workerService.renewEventInfo(event);
    }

    @RequestMapping("/newEventInfo")
    public int newEventInfo(@RequestBody Event event) {
        return workerService.newEventInfo(event);
    }

    @RequestMapping("/delEventInfo")
    public int delEventInfo(@RequestBody Event event) {
        return workerService.delEventInfo(event);
    }

    @RequestMapping("/delAllEventInfo")
    public int delAllEventInfo() {
        return workerService.delAllEventInfo();
    }

    @RequestMapping("/getEventId")
    public String getEventId(Event event) {
        return workerService.getEventId(event);
    }

    @RequestMapping("/getUserName")
    public User getUserName(User user) {
        return workerService.getUserName(user);
    }


}
